package com.tensquare.usr.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.tensquare.usr.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao extends BaseMapper<User> {
    @Select("SELECT * from tb_user where mobile=#{mobile}")
    User findByMobile(String mobile);
    @Select("UPDATE tb_user SET fanscount=fanscount+#{x} WHERE id=#{friendid}")
    void incFanscount(@Param("friendid") String friendid, @Param("x") int x);
    @Select("UPDATE tb_user SET followcount=followcount+#{x} WHERE id=#{userid}")
    void incFollowcount(String userid, int x);
}
